{{include file="header.tpl"}}
<script type="text/javascript" src="res/js/geo_selection.js"></script>
<script type="text/javascript">
$(function(){
	var initGeoCode = "3";    
	geoSelection.firstGeoLevel = 1;
	geoSelection.lastGeolevel = 5;
	geoSelection.geoInputName = "geo_code";
	geoSelection.geoLayerId = "geo_selection";
	geoSelection.initSelected(initGeoCode);
	//geoSelection.initGeoSelection(68173824);
});
</script>
<script type="text/javascript" src="res/js/formvalidator/formValidator-4.1.3.js"></script>
<script type="text/javascript" src="res/js/formvalidator/formValidatorRegex.js" ></script>
<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({theme:"126",formID:"signup-user-form",mode:'AutoTip',onError:function(msg){alert(msg)},inIframe:true});
	$("#username").formValidator({onShow:"请输入手机号码",onFocus:"手机号码必须为11位,请确认",onCorrect:"该手机号码可以注册"}).inputValidator({min:11,max:11,onError:"手机号码必须为11位,请确认"}).regexValidator({regExp:"mobile",dataType:"enum",onError:"手机的格式不正确"})
	    .ajaxValidator({
		dataType : "json",
		async : true,
		url : "index.php?{{$TIN_CTL}}=user&{{$TIN_ACT}}=chk",
		success : function(data){
            if(data.code=='success') {
            	return true;
            }else{
            	return data.msg;
            }
			
		},
		buttons: $("#submit"),
		error: function(jqXHR, textStatus, errorThrown){alert("服务器没有返回数据，请重试"+errorThrown);},
		onError : "该手机号码不可用，请更换手机号码",
		onWait : "正在校验，请稍候..."
	});
	$("#password1").formValidator({onShowFixText:"6~16个字符，包括字母、数字、特殊符号，区分大小写",onShow:"请输入密码",onFocus:"至少6个长度",onCorrect:"密码合法"}).inputValidator({min:6,max:16,empty:{leftEmpty:false,rightEmpty:false,emptyError:"密码两边不能有空符号"},onError:"密码长度错误,请确认"}).passwordValidator({continueChar:false,sameChar:false,compareID:"username"});
	$("#password2").formValidator({onShowFixText:"请再次输入密码",onShow:"输再次输入密码",onFocus:"至少1个长度",onCorrect:"密码一致"}).inputValidator({min:1,empty:{leftEmpty:false,rightEmpty:false,emptyError:"重复密码两边不能有空符号"},onError:"重复密码不能为空,请确认"}).compareValidator({desID:"password1",operateor:"=",onError:"2次密码不一致,请确认"});
    $("#email").formValidator({onShowFixText:"6~18个字符，包括字母、数字、下划线，以字母开头，字母或数字结尾",onShow:"请输入邮箱",onFocus:"邮箱6-100个字符,输入正确了才能离开焦点",onCorrect:"恭喜你,你输对了",defaultValue:"@"}).inputValidator({min:6,max:100,onError:"你输入的邮箱长度非法,请确认"}).regexValidator({regExp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$",onError:"你输入的邮箱格式不正确"});
    $("#idcard").formValidator({onShow:"请输入15或18位的身份证",onfocus:"输入15或18位的身份证",onCorrect:"输入正确"}).regexValidator({regExp:"idcard",dataType:"enum",onError:"你输入的身份证格式不正确"});;
    $("#address").formValidator({onShow:"请输入详细地址",onfocus:"请输入详细地址",onCorrect:"输入正确"}).inputValidator({min:2,onError:"请输入详细地址"}).regexValidator({regExp:"notempty",dataType:"enum",onError:"请输入详细地址"});
    $("#realname").formValidator({onShow:"请输入真实姓名",onfocus:"请输入真实姓名",onCorrect:"输入正确"}).inputValidator({min:2,onError:"请输入真实姓名"}).regexValidator({regExp:"notempty",dataType:"enum",onError:"请输入真实姓名"});
	//$("#checkCode").formValidator({onShow:"请输入验证码",onfocus:"请输入验证码",onCorrect:"输入正确"}).inputValidator({min:4,onError:"请输入验证码"}).regexValidator({regExp:"num",dataType:"enum",onError:"请输入验证码"});

    $("#geo_level2").formValidator({tipID:"geo_codeTip",onShow:"至少1个长度",onCorrect:""}).inputValidator({min:1,onError: "请选择所在市!"}).defaultPassed();
    $("#geo_level3").formValidator({tipID:"geo_codeTip",onShow:"至少1个长度",onCorrect:""}).inputValidator({min:1,onError: "请选择所在地区!"}).defaultPassed();
    $("#geo_level4").formValidator({tipID:"geo_codeTip",onShow:"至少1个长度",onCorrect:""}).inputValidator({min:1,onError: "请选择所在乡镇!"}).defaultPassed();
    $("#geo_level5").formValidator({tipID:"geo_codeTip",onShow:"至少1个长度",onCorrect:""}).inputValidator({min:1,onError: "请选择所在村级!"}).defaultPassed();

    $.formValidator.reloadAutoTip();
});
function chkgeo(){
        if($("#geo_level2").find("option").length<=1){ $("#geo_level2").unFormValidator(true); }else{$("#geo_level2").unFormValidator(false);}
        if($("#geo_level3").find("option").length<=1){ $("#geo_level3").unFormValidator(true); }else{$("#geo_level3").unFormValidator(false);}
        if($("#geo_level4").find("option").length<=1){ $("#geo_level4").unFormValidator(true); }else{$("#geo_level4").unFormValidator(false);}
        if($("#geo_level5").find("option").length<=1){ $("#geo_level5").unFormValidator(true); }else{$("#geo_level5").unFormValidator(false);}
}
</script>
<div class="login_inter">
	<div class="w1002 login_mid">
    	<div class="login_con">
        	<i></i>
            <div class="reg_steps">
            <form action="index.php?{{$TIN_CTL}}=user&{{$TIN_ACT}}=Reg1" method="post" id="signup-user-form" onsubmit="chkgeo();">
       		<table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="25%" align="right">手机号码：</td>
                    <td width="75%"><input name="username" id="username"  autocomplete="off"  type="text" class="textinput" /></td>
                </tr>
                <tr>
                    <td align="right">设置登录密码：</td>
                    <td><input name="password" type="password" id="password1" autocomplete="off" class="textinput" />
                    </td>
                </tr>
<!--                 <tr>
                    <td>&nbsp;</td>
                    <td class="Password_steg"> <span class="cur">弱</span><span>中</span><span>很强</span></td>
                </tr> -->
                <tr>
                    <td align="right">确认登录密码：</td>
                    <td><input name="password_confirm" type="password" id="password2" class="textinput" /></td>
                </tr>
<!--                 <tr>
                    <td width="25%" align="right">手机号码：</td>
                    <td width="75%"><input name="phone"  type="text" id="phone" class="textinput" /></td>
                </tr> -->
                <tr>
                    <td align="right">现住地址：</td>
                    <td  id="geo_selection" class="clear" style="line-height:25px;">
                        <div style="float:left;">   
                        	<select name="geo_level1" id="geo_level1" style="width:80px;"></select>
                            <select name="geo_level2" id="geo_level2" style="width:80px;"></select>
                            <select name="geo_level3" id="geo_level3" style="width:80px;"></select><br/>
                            <select name="geo_level4" id="geo_level4" style="width:80px;"></select>
                            <select name="geo_level5" id="geo_level5" style="width:80px;"></select>
                        </div>
                        <div id="geo_codeTip" ></div>
                        <input type="hidden" name="geo_code" id="geo_code" value="0" />
					</td>
                </tr>
                <tr>
                    <td align="right">详细地址：</td>
                    <td><input name="address" id="address" type="text" class="textinput" /></td>
                </tr>
                <tr>
                    <td align="right">邮箱：</td>
                    <td><input name="email" id="email" type="text" class="textinput" /></td>
                </tr>
                <tr>
                    <td align="right">真实姓名：</td>
                    <td><input name="realname" id="realname" type="text" class="textinput" /></td>
                </tr>
                <tr>
                    <td align="right">身份证：</td>
                    <td><input name="idcard" id="idcard" type="text" class="textinput" /></td>
                </tr>
                <tr>
                    <td align="right">性别：</td>
                    <td>
                        <input type="radio" id="sex" value="1" name="sex" checked="checked" />男&nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="radio" id="sex1" value="2" name="sex" />女
                     </td>
                </tr>
<!--                 <tr>
                    <td align="right">验证码：</td>
                    <td><input name="checkCode" id="checkCode" type="text" class="textinput" /><img id="chkcode" src="res/vcode.php" style="cursor:pointer" width="60" height="25"></td>
                </tr> -->
                <tr>
                    <td align="right"></td>
                    <td><input id="submit" type="submit" value="" style="width:164px; height:30px;background:url(res/images/submit.jpg) no-repeat;border:0;cursor: pointer;"/><a href="#">点击查看协议</a></td>
                </tr>
            </table>
			</form>

            </div>
        </div>
	</div>
</div>
{{include file="footer.tpl"}}